#!/bin/sh
#
# Copyright (C) 2000-2022 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#

. scripts/functions

SCR=$cwd/bin/bacula-ctl
sed "s:BACDIRBIN=$cwd/bin:BACDIRBIN=$bin:" $SCR-dir > tmp/1
mv tmp/1 $SCR-dir
sed "s:BACSDBIN=$cwd/bin:BACSDBIN=$bin:" $SCR-sd > tmp/1
mv tmp/1 $SCR-sd
sed "s:BACFDBIN=$cwd/bin:BACFDBIN=$bin:" $SCR-fd > tmp/1
mv tmp/1 $SCR-fd
chmod -x $cwd/bin/bacula-fd $cwd/bin/bacula-sd $cwd/bin/bacula-dir $cwd/bin/bconsole    
chmod +x $SCR-*
if [ x$plugins != x ]; then
    mv $cwd/bin/plugins $cwd/bin/plugins.org
    ln -s $plugins $cwd/bin/plugins
fi

